package com.aaa.hospital.service.impl;

import com.aaa.hospital.mapper.LogMapperPlus;
import com.aaa.hospital.pojo.domain.Log;
import com.aaa.hospital.pojo.query.LogQuery;
import com.aaa.hospital.result.AjaxResult;
import com.aaa.hospital.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: danghui
 * @Date: 2022/2/14 15:04
 * @Description: TODO
 */
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapperPlus logMapper;

    @Override
    public AjaxResult listAllLog(LogQuery query) {
        List<Log> log = logMapper.listAllLog(query);
        Long aLong = logMapper.listLogTotal(query);
        HashMap<Object, Object> data = new HashMap<>();
        data.put("currentData",log);
        data.put("totalCount",aLong);
        return AjaxResult.success(data);
    }
}
